#	The example below is taken from a program which calculates the area of a circle. The program reads in a value for the radius and writes
#	out the area of the circle. Without prompts, the user`s view of such a program is very bleak - that is there is no indication of what the
#	input is for or when it should be supplied nor is there an explanation of the output. By including some character constants (or literals) in
#	the output, the user's view of the program can be greatly enhanced. For example: 
#
#	   WRITE (*,*) `Please type a value for the radius of a circle`
#	   READ (*,*) radius
#	   area = pi*radius*radius
#	   WRITE (*,*) `The area of a circle of radius `, radius, &
#		  ` is `, area
#
#	The characters which appear between pairs of apostrophes are character constants and will appear on screen as: 
#
#	   Please type a value for the radius of a circle
#	   12.0
#	   The area of a circle of radius 12.0 is 452.38925
#
#	The double quote character may also be used to define character literals. If a string of characters is to contain one of the delimiting
#	characters (apostrophes or double quotes) then the other may be used as the delimiters. However if the string is to contain both delimiting
#	characters or a programmer wishes to always define strings using the same character then the delimiter should be given in the string as
#	two adjacent delimiters (apostrophes or double quotes, as appropriate). These are then treated as a single character. 
#
#	   "This string contains an apostrophe '."
#	   'This string contains a double quote ".'
#	   "This string contains an apostrophe ' and a double quote ""."
#
#	This would appear in output as: 
#
#	   This string contains an apostrophe '.
#	   This string contains a double quote ".
#	   This string contains an apostrophe ' and a double quote ".

from SyntaxDesc import *
import Register
def Syntax():
	return SyntaxDesc(
		WordsCaseInsensitive(gStyleStructKeyword,
			"ALLOCATABLE",
			"ALLOCATE",
			"ASSIGN",
			"BACKSPACE",
			"BLOCK",
			"CALL",
			"CASE",
			"CHARACTER",
			"CLOSE",
			"COMMON",
			"COMPLEX",
			"CONTAINS",
			"CONTINUE",
			"CYCLE",
			"DATA",
			"DEALLOCATE",
			"DIMENSION",
			"DO",
			"DOUBLE",
			"ELSE",
			"ELSEWHERE",
			"END",
			"END/DO",
			"END/FILE",
			"ENTRY",
			"EQUIVALENCE",
			"EXIT",
			"EXTERNAL",
			"FILE",
			"FORMAT",
			"FUNCTION",
			"GO",
			"IF",
			"IMPLICIT",
			"INQUIRE",
			"INTEGER",
			"INTENT",
			"INTERFACE",
			"INTRINSIC",
			"LOGICAL",
			"MODULE",
			"NAMELIST",
			"NONE",
			"NULLIFY",
			"OPEN",
			"OPTIONAL",
			"PARAMETER",
			"PAUSE",
			"POINTER",
			"PRECISION",
			"PRINT",
			"PRIVATE",
			"PROGRAM",
			"PUBLIC",
			"READ",
			"REAL",
			"RECURSIVE",
			"RETURN",
			"REWIND",
			"SAVE",
			"SELECT",
			"SEQUENCE",
			"STOP",
			"SUBROUTINE",
			"TARGET",
			"THEN",
			"TO",
			"TYPE",
			"USE",
			"WHERE",
			"WRITE",
		),
		Regex(gStyleStructKeyword,
			"[.]\(NOT\|AND\|OR\|EQV\|NEQV\|EQ\|NE\|LT\|LE\|GT\|GE\|FALSE\|TRUE\)[.]",
			ignorecase=1
		),
		Regex(gStyleString,
			'\("[^\n"]*"\|\'[^\'\n]*\'\)'
		),
		IfCommentHighlight(Regex(gStyleComment,'^[CXcx*].*')),
	)

Register.RegisterSyntax(Syntax,"Fortran","Fortran77","Fortran77 Include","Fortran90")
